program i;

{$APPTYPE CONSOLE}

var
  h, k: Integer;
begin
  readln(n, s);
  for i := 1 to n do
    read(a[i]);
  for i := 1 to n do
    read(b[i]);
  for i := 1 to n do
    s := s - abs(a[i]-b[i]);
  writeln(s:0:0);
end.
